Skip to main content

Calculate distance covered

POST {{base_url}}/orders/shipping/distance-covered

Description

This API endpoint calculates the distance covered based on the longitude and latitude coordinates of the buyer's location and the seller's locations.

Request

Request Headers:

NameDescription
tenantId(required, header) The tenant ID associated with the request.
countryCode(required, header) The country code associated with the request.

Request Body Schema (JSON):

{
"buyerLocation": {
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string"
},
"sellerLocations": [
{
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string"
}
]
}

Example:

<distanceCalculationRequest>
<buyerLocation>
<latitude>0</latitude>
<longitude>0</longitude>
<address class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>string</address>
<userId>string</userId>
</buyerLocation>
<sellerLocations>
<sellerLocation>
<latitude>0</latitude>
<longitude>0</longitude>
<address class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>string</address>
<userId>string</userId>
</sellerLocation>
</sellerLocations>
</distanceCalculationRequest>

Responses:

Status: 200 OK Description: Distance calculation successful.

Response Body Schema (JSON):

{
"status": "boolean",
"statusCode": "integer",
"message": "string",
"data": {},
"errors": [
{
"message": "string",
"descriptiveMessage": "string"
}
]
}

Example:

<distanceCalculationResponse>
<status>true</status>
<statusCode>0</statusCode>
<message>string</message>
<data></data>
<errors>
<error>
<message>string</message>
<descriptiveMessage>string</descriptiveMessage>
</error>
</errors>
</distanceCalculationResponse>

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /orders/shipping/distance-covered \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!